package io.jee.runshan.domain.remote.weixin;

import io.jee.runshan.utils.WeixinConstant;

import java.io.Serializable;

public class WeixinResponse implements Serializable {
	private static final long serialVersionUID = 1979084157532820783L;

	private Boolean success = false;
	private String access_token;
	private long expires_in;
	private int errcode;
	private String errmsg;
	private String[] ip_list;

	public Boolean success() {
		return success;
	}
	
	public String message() {
		return WeixinConstant.getProperty(this.errcode);
	}

	public String getAccess_token() {
		return access_token;
	}

	public void setAccess_token(String access_token) {
		this.access_token = access_token;
	}

	public long getExpires_in() {
		return expires_in;
	}

	public void setExpires_in(long expires_in) {
		this.expires_in = expires_in;
	}

	public int getErrcode() {
		return errcode;
	}

	public void setErrcode(int errcode) {
		this.errcode = errcode;
		this.success = errcode == 0;
	}

	public String getErrmsg() {
		return errmsg;
	}

	public void setErrmsg(String errmsg) {
		this.errmsg = errmsg;
	}

	public String[] getIp_list() {
		return ip_list;
	}

	public void setIp_list(String[] ip_list) {
		this.ip_list = ip_list;
	}

}
